$("#add_project_btn").click(function(){
	$("#add_project_panel").modal('hide');
});

$(document).ready(function() {
	 var options = {
	     success : function(data) {
	         if (data.result == "true"){
	        	 alert("上传成功");
	         }else{
	        	 alert("上传失败");
	         }
	     }
	 };
	 $("#import-rhapsody-form").ajaxForm(options);
});

function mapRhapsodyFile(projectId){
	$.ajax({
		type : "POST",
		url : '/ManEnv/rhapsody/' + projectId + '/mapDesignPattern',
		success : function(data) {
			if(data.result == "true"){
				alert("导入成功!");
			}else{
				alert("导入失败!");
			}
		}});
}

function valid() {
	var rhapsody_file = $("input[name='rhapsody_file']").val();
	if (rhapsody_file == "") {
		$("#rhapsody_file_div").removeClass("control-group");
		$("#rhapsody_file_div").addClass("control-group error");
		$("#rhapsody_file_help").text("文件不能为空");
		return false;
	}
	return true;
}
